<?php
session_start();
$page_name=basename($_SERVER['SCRIPT_FILENAME']);
$IsPreserved	= 'Y';
$IsProcess		= $_REQUEST['IsProcess'];
$action         = $_REQUEST['action'];
$action_arr = array("getSrchResult");
if(in_array($action,$action_arr))
{
	$IsProcess = 'Y';
}
include "general_include.php";


if($IsProcess <> 'Y')
{
	include "top.php";
}
$record_per_page = !empty($record_per_page)?$record_per_page:10;
$paginationObj = new PaginationClassFrontAjax($record_per_page,4,1,'Next','Previous');





 $SelectnewsSQL="SELECT *, date_format(".date_added.",'%M  %d , %Y at %h :%i %p') as n_date FROM ".TABLEPREFIX."_news where is_active='Y' order by date_added desc";
 //echo $SelectnewsSQL;
 $pagination_arr = $paginationObj->PaginationFrontAjaxALL('PaginationSearch',$SelectnewsSQL,$page_name.'?'.$catLink);
 
 $NewsArr=$UserManagerObjAjax->GetRecords("All",$pagination_arr[0]);
	//echo $pagination_arr[0];
 $NumNews=count($NewsArr);
	
for($i=0;$i<$NumStudent;$i++)
{
	$NewsArr[$i]['news_title']=show_to_control($NewsArr[$i]['name']);
	$NewsArr[$i]['news_content']=show_to_control($NewsArr[$i]['news_content']);
}



$smarty->assign("IsProcess",$IsProcess);
$smarty->assign('catLink',$catLink);
$smarty->assign('page_name',$page_name);
$smarty->assign('record_per_page',$record_per_page);

$smarty->assign("NewsArr",$NewsArr);
$smarty->assign('pagination_arr',$pagination_arr);	
$smarty->assign("NumNews",$NumNews);
$smarty->assign("totRec",$totRec);
//$smarty->register_modifier("in_array","in_array");

if($IsProcess <>'Y')
  include "left.php";
$smarty->display('news.tpl');
if($IsProcess <> 'Y')
	 include "footer.php";
?>